package com.example.demo.security;

import javax.servlet.http.HttpServletRequest;
import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.stereotype.Component;

/**
 * @author xkx
 * @version 1.0.0
 * @datetime 2019/2/11 18:22
 * @description
 */
@Component
public class CustomAuthenticationDetailsSource implements
    AuthenticationDetailsSource<HttpServletRequest, WebAuthenticationDetails> {

  @Override
  public WebAuthenticationDetails buildDetails(HttpServletRequest request) {
    return new CustomWebAuthenticationDetails(request);
  }
}
